/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Saldo_Prestamo.java
 *
 * Created on 18/11/2011, 08:30:44 PM
 */
package Vista;

import DAO_Modelo.dto.Cuenta;
import DAO_Modelo.dto.Notificacionesjudiciales;
import DAO_Modelo.dto.Prestamo;
import DAO_Modelo.dto.Socio;
import DAO_Modelo.exceptions.CuentaDaoException;
import DAO_Modelo.exceptions.NotificacionesjudicialesDaoException;
import DAO_Modelo.exceptions.PrestamoDaoException;
import DAO_Modelo.exceptions.SocioDaoException;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import jxl.Workbook;
import jxl.format.Colour;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;

/**
 *
 * @author jose,digberht
 */
public class Saldo_Prestamo extends javax.swing.JFrame {
    
    Vector<String[]> contenido_saldo_prest_temp;
    public Object contenido_saldo_prest[][];
    String etiquetas_saldo_prest[];
    
    public static String addresexcel="C:/Archivos de programa/Microsoft Office/Office12/EXCEL.exe";
    public static String nameexcel="C:/Demandas/Relacion_Socios_Demanda_Completa"+NombreArchivo()+"a.xls";
    
    /**Creacion de nuevo formulario para Saldo_Prestamo */
    
    
    
    public Saldo_Prestamo() {
        contenido_saldo_prest_temp=new Vector<String[]>();
        //"nro","Codigo","Nombre","Dias Atrazo","Deuda Vencida"
        etiquetas_saldo_prest=new String [] {"nro","Codigo","Nombre","Dias Atrazo","Deuda Vencida"};
        initComponents();
        jTable_SaldoContenido.setModel(new javax.swing.table.DefaultTableModel(new Object [][] {{ null, null, null, null, null, null}},etiquetas_saldo_prest));
        jText_SaldoP_DiasAtraso.setText("31");
        jText_SaldoP_DiasAtrasoFinal.setText("10000");
        jButton_EstadoDeman.setEnabled(false);
    }

     public static String NombreArchivo(){
        Calendar calendarioAhora = Calendar.getInstance();
        calendarioAhora.add(Calendar.HOUR, -5);
        Date dateAhora = calendarioAhora.getTime();
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-ddHH-mm-ss");
        
        return (formato.format(dateAhora));
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jText_SaldoP_DiasAtraso = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jText_SaldoP_DiasAtrasoFinal = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable_SaldoContenido = new javax.swing.JTable();
        jButton_SaldoPrestamo_Visualizar = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton_EstadoDeman = new javax.swing.JButton();
        jButton_Reportes = new javax.swing.JButton();
        jButton_ReporteCompleto = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Saldo de Prestamo"));

        jLabel3.setText("Dias de Atrazo");

        jLabel4.setText("a");

        jLabel5.setText("(31-10000)");

        jTable_SaldoContenido.setAutoCreateRowSorter(true);
        jTable_SaldoContenido.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_SaldoContenidoMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable_SaldoContenido);

        jButton_SaldoPrestamo_Visualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/buscar.JPG"))); // NOI18N
        jButton_SaldoPrestamo_Visualizar.setText("Visualizar");
        jButton_SaldoPrestamo_Visualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SaldoPrestamo_VisualizarActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/salisr.JPG"))); // NOI18N
        jButton3.setText("Cerrar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton_EstadoDeman.setText("Estado de Demanda");
        jButton_EstadoDeman.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_EstadoDemanActionPerformed(evt);
            }
        });

        jButton_Reportes.setText("Reportes con Filtros");
        jButton_Reportes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_ReportesActionPerformed(evt);
            }
        });

        jButton_ReporteCompleto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/excel.JPG"))); // NOI18N
        jButton_ReporteCompleto.setText("Reporte Completo");
        jButton_ReporteCompleto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_ReporteCompletoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 569, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton_EstadoDeman)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton_Reportes)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton_ReporteCompleto, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, Short.MAX_VALUE)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(10, 10, 10)
                        .addComponent(jText_SaldoP_DiasAtraso, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)
                        .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jText_SaldoP_DiasAtrasoFinal, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addGap(18, 18, 18)
                        .addComponent(jButton_SaldoPrestamo_Visualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_SaldoPrestamo_Visualizar)
                    .addComponent(jLabel5)
                    .addComponent(jText_SaldoP_DiasAtrasoFinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jText_SaldoP_DiasAtraso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4))
                .addGap(34, 34, 34)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_EstadoDeman)
                    .addComponent(jButton3)
                    .addComponent(jButton_Reportes)
                    .addComponent(jButton_ReporteCompleto))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
/** 
	 * Funcion de evento que lanza un nuevo formulario el cual es estado de demanda
	 */  
private void jButton_EstadoDemanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_EstadoDemanActionPerformed
// TODO add your handling code here:
    Sigele.estado_demanda= new Estado_Demanda(Sigele.prestamodtoLista[jTable_SaldoContenido.getSelectedRow()].getCodigoSocio());
    Sigele.estado_demanda.setVisible(true);
}//GEN-LAST:event_jButton_EstadoDemanActionPerformed
/** 
	 * Funcion de evento de saldo de prestamo que muestra los resultado en la lista
	 */  
private void jButton_SaldoPrestamo_VisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SaldoPrestamo_VisualizarActionPerformed
    
    
    jTable_SaldoContenido.setModel(new javax.swing.table.DefaultTableModel(new Object [][] {{ null, null, null, null, null, null}},etiquetas_saldo_prest));
    contenido_saldo_prest_temp=new Vector<String[]>();
    contenido_saldo_prest=new Object [][] {{ null, null, null, null, null, null}};
   String dias_ini=jText_SaldoP_DiasAtraso.getText();
   String dias_fin=jText_SaldoP_DiasAtrasoFinal.getText();
    try {        
            Sigele.prestamodtoLista = Sigele.prestamoDao.findAll();
            int cont=1;
            for (int i = 0; i < Sigele.prestamodtoLista.length; i++) {
               if(Sigele.prestamodtoLista[i].getDiasRetraso()>=Integer.valueOf(dias_ini)
                    && Sigele.prestamodtoLista[i].getDiasRetraso()<=Integer.valueOf(dias_fin)){
                    System.out.println("codigo resultado socio "+Sigele.prestamodtoLista[i].getCodigoSocio());
                    String tmp[]=new String[] {String.valueOf(cont),String.valueOf(Sigele.socioDao.findByPrimaryKey(Sigele.prestamodtoLista[i].getCodigoSocio()).getCodigoSocio()),
                        String.valueOf(Sigele.socioDao.findByPrimaryKey(Sigele.prestamodtoLista[i].getCodigoSocio()).getNombre())+" "+String.valueOf(Sigele.socioDao.findByPrimaryKey(Sigele.prestamodtoLista[i].getCodigoSocio()).getApellidos()),
                        String.valueOf(Sigele.prestamodtoLista[i].getDiasRetraso()),String.valueOf(Sigele.prestamodtoLista[i].getDeudaVencida())};
                   contenido_saldo_prest_temp.add(tmp);     
                   cont++;
               }
            }
            contenido_saldo_prest= new Object[contenido_saldo_prest_temp.size()][etiquetas_saldo_prest.length];
        for (int i = 0; i < contenido_saldo_prest_temp.size(); i++) {
            contenido_saldo_prest[i]=contenido_saldo_prest_temp.get(i);
        }
        jTable_SaldoContenido.setModel(new javax.swing.table.DefaultTableModel(contenido_saldo_prest,etiquetas_saldo_prest));
        
        } catch (PrestamoDaoException ex) {
            Logger.getLogger(Saldo_Prestamo.class.getName()).log(Level.SEVERE, null, ex);
        }catch (SocioDaoException ex) {
            Logger.getLogger(Saldo_Prestamo.class.getName()).log(Level.SEVERE, null, ex);
        }
           
    jButton_EstadoDeman.setEnabled(false);
}//GEN-LAST:event_jButton_SaldoPrestamo_VisualizarActionPerformed
/** 
	 * Funcion de evento que cierra el formulario actualactivo
	 */  
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
    this.dispose();
}//GEN-LAST:event_jButton3ActionPerformed
/** 
	 * Funcion de evento el cual perimite  seleccionar una fila de la tabla jTable_SaldoContenido
	 */  
private void jTable_SaldoContenidoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_SaldoContenidoMouseClicked
// TODO add your handling code here:
    int filaSeleccionada=-1;
    for (int i = 0; i < jTable_SaldoContenido.getRowCount(); i++) {
        if(jTable_SaldoContenido.isRowSelected(i)){
            filaSeleccionada=i;
            break;
        }
    }
    if(filaSeleccionada>=0){
        boolean f=true;
        for (int i = 0; i < jTable_SaldoContenido.getColumnCount(); i++) {
            if(jTable_SaldoContenido.getValueAt(0, 0)==null)
                f=false;
        }
        if(f)
            jButton_EstadoDeman.setEnabled(true);
    }
        
}//GEN-LAST:event_jTable_SaldoContenidoMouseClicked

private void jButton_ReportesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ReportesActionPerformed
// TODO add your handling code here:
    Sigele.reportes.setVisible(true);
}//GEN-LAST:event_jButton_ReportesActionPerformed

public static void escribirExcel(Vector<Prestamo> prestamo,Vector<Notificacionesjudiciales> nj,Vector<Socio> socios,Vector<Integer> pos,Vector<Cuenta> c)
    {
 
        try
        {
            //Se crea el libro Excel
            WritableWorkbook workbook =Workbook.createWorkbook(new File(nameexcel));
 
            //Se crea una nueva hoja dentro del libro
            WritableSheet sheet =workbook.createSheet("Por Juzgado", 0);
 
            //Creamos celdas de varios tipos
            WritableFont times16font = new WritableFont(WritableFont.TIMES, 10, WritableFont.BOLD, true); 
            times16font.setColour(Colour.BLACK);
            WritableCellFormat formato1 = new WritableCellFormat(times16font); 
            formato1.setBackground(Colour.YELLOW);
            int fila =1,col=2;
            
            sheet.addCell(new jxl.write.Label(1, 2, "Reporte por dias de atrazo",formato1));
            sheet.mergeCells(1, 2, 3, 2);
            sheet.addCell(new jxl.write.Label(1, 3, "Nº",formato1));
            sheet.setColumnView(1,4);
            sheet.addCell(new jxl.write.Label(2, 3, "Cuenta",formato1));
            sheet.setColumnView(2,8);
            sheet.addCell(new jxl.write.Label(3, 3, "Socio",formato1));
            sheet.setColumnView(3,30);
            sheet.addCell(new jxl.write.Label(4, 3, "Fecha de Prestamo",formato1));
            sheet.setColumnView(4,18);
            sheet.addCell(new jxl.write.Label(5, 3, "Monto Original",formato1));
            sheet.setColumnView(5,14);
            sheet.addCell(new jxl.write.Label(6, 3, "Monto Demandado",formato1));
            sheet.setColumnView(6,16);
            sheet.addCell(new jxl.write.Label(7, 3, "Juzgado",formato1));
            sheet.setColumnView(7,25);
            sheet.addCell(new jxl.write.Label(8, 3, "Ultima Diligencia",formato1));
            sheet.setColumnView(8,18);
            sheet.addCell(new jxl.write.Label(9, 3, "Est. Proceso Jud.",formato1));
            sheet.setColumnView(9,18);
            sheet.addCell(new jxl.write.Label(10, 3, "Fecha Ult. Pago",formato1));
            sheet.setColumnView(10,15);
            sheet.addCell(new jxl.write.Label(11, 3, "Saldo Cap. Actual",formato1));
            sheet.setColumnView(11,18);
            sheet.addCell(new jxl.write.Label(12, 3, "Monto Recuperado",formato1));
            sheet.setColumnView(12,18);
            sheet.addCell(new jxl.write.Label(13, 3, "Observaciones",formato1));
            sheet.setColumnView(13,40);
            sheet.addCell(new jxl.write.Label(14, 3, "Cancelo Deuda",formato1));
            sheet.setColumnView(14,13);
            
            
            for (int j = 0; j < prestamo.size(); j++) {
            //sheet.addCell(new jxl.write.Label(0, 0, "Nº",formato1));
            sheet.addCell(new jxl.write.Label(1, 4+j, String.valueOf(1+j)));
            sheet.addCell(new jxl.write.Label(2, 4+j, String.valueOf(c.get(j).getCodigoCuenta())));
            sheet.addCell(new jxl.write.Label(3, 4+j, socios.get(j).getNombre()+" "+socios.get(j).getApellidos()));
            sheet.addCell(new jxl.write.Label(4, 4+j, new java.sql.Date(prestamo.get(j).getFechaPrestamo().getTime()).toString()));
            sheet.addCell(new jxl.write.Label(5, 4+j, String.valueOf(prestamo.get(j).getMontoOriginal())));
            sheet.addCell(new jxl.write.Label(6, 4+j, String.valueOf(nj.get(j).getMontoDemandado())));
            sheet.addCell(new jxl.write.Label(7, 4+j, String.valueOf(nj.get(j).getJuzgado())));
            sheet.addCell(new jxl.write.Label(8, 4+j, new java.sql.Date(nj.get(j).getUltimaDiligencia().getTime()).toString()));
            sheet.addCell(new jxl.write.Label(9, 4+j, String.valueOf(nj.get(j).getEstadoProcesoJudicial())));
            sheet.addCell(new jxl.write.Label(10, 4+j, new java.sql.Date(nj.get(j).getFehaUltimoPago().getTime()).toString()));
            sheet.addCell(new jxl.write.Label(11, 4+j, String.valueOf(nj.get(j).getSaldoActual())));
            sheet.addCell(new jxl.write.Label(12, 4+j, String.valueOf(nj.get(j).getMontoRecuperado())));
            sheet.addCell(new jxl.write.Label(13, 4+j, String.valueOf(prestamo.get(j).getObservaciones())));
            sheet.addCell(new jxl.write.Label(14, 4+j, String.valueOf(prestamo.get(j).getCalceladoDeuda())));
            
                
            }
            
            workbook.write();
            workbook.close();
            
            System.out.println("Ejemplo finalizado.");
            
        }
        catch (IOException ex)
        {
            System.out.println("Error al crear el fichero.");
        }
        catch (WriteException ex)
        {
            System.out.println("Error al escribir el fichero.");
        }
    }

public static void Abrir(){
        
    Runtime excel = Runtime.getRuntime();
        try{
        excel.exec((addresexcel+" "+nameexcel).toString());
        }
        catch(Exception e){
        System.out.println(e);
        }
    }
private void jButton_ReporteCompletoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ReporteCompletoActionPerformed
// TODO add your handling code here:
    
    
    String dias_ini=jText_SaldoP_DiasAtraso.getText();
    String dias_fin=jText_SaldoP_DiasAtrasoFinal.getText();
    Vector<Prestamo> vector=new Vector<Prestamo>();
    Vector<Socio> socio=new Vector<Socio>();
    Vector<Notificacionesjudiciales> nj=new Vector<Notificacionesjudiciales>();
    Vector<Integer> contador=new Vector<Integer>();//no se usa
    Vector<Cuenta> cuentas=new Vector<Cuenta>();
        try {
            Prestamo []p=Sigele.prestamoDao.findAll();
            for (int i = 0; i < p.length; i++) {
               if(p[i].getDiasRetraso()>=Integer.valueOf(dias_ini)
                    && p[i].getDiasRetraso()<=Integer.valueOf(dias_fin)){
                   socio.add(Sigele.socioDao.findByPrimaryKey(p[i].getCodigoSocio()));
                   if(Sigele.not_judDao.findWhereCodigoSocioEquals(p[i].getCodigoSocio()).length>0){
                       nj.add(Sigele.not_judDao.findWhereCodigoSocioEquals(p[i].getCodigoSocio())[0]);
                       contador.add(p[i].getCodigoSocio());
                   }
                   cuentas.add(Sigele.cuentaDao.findWhereCodigoSocioEquals(p[i].getCodigoSocio())[0]);
                   vector.add(p[i]);     
               }
            }
            
            escribirExcel(vector,nj,socio, contador,cuentas);
            Abrir();
         } catch (CuentaDaoException ex) {
            Logger.getLogger(Saldo_Prestamo.class.getName()).log(Level.SEVERE, null, ex);
        } catch (NotificacionesjudicialesDaoException ex) {
            Logger.getLogger(Saldo_Prestamo.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SocioDaoException ex) {
            Logger.getLogger(Saldo_Prestamo.class.getName()).log(Level.SEVERE, null, ex);
        } catch (PrestamoDaoException ex) {
            Logger.getLogger(Saldo_Prestamo.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
}//GEN-LAST:event_jButton_ReporteCompletoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Saldo_Prestamo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Saldo_Prestamo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Saldo_Prestamo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Saldo_Prestamo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Saldo_Prestamo().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton_EstadoDeman;
    private javax.swing.JButton jButton_ReporteCompleto;
    private javax.swing.JButton jButton_Reportes;
    private javax.swing.JButton jButton_SaldoPrestamo_Visualizar;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable_SaldoContenido;
    private javax.swing.JTextField jText_SaldoP_DiasAtraso;
    private javax.swing.JTextField jText_SaldoP_DiasAtrasoFinal;
    // End of variables declaration//GEN-END:variables
}
